home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 009 / ansipach.arc / ANSIPACH.TXT
Encoding:
Text File  |  1986-09-19  |  2.3 KB  |  51 lines

  1. Here is a usefull little patch for those of you who use the ANSI.SYS 
  2. device driver, and wish like to have it set the screen color for you.
  3. Unfortunately, it is impossible using ANSI.SYS to set the color of the 
  4. screen border.  This makes for an ugly screen in my opinion.  I decided
  5. to replace one useless ANSI.SYS command with a command which will set 
  6. the screen border color; specifically the  ESC[=#h  command, which will
  7. set the screen mode to 80 column, 40 column, black&white, and color.
  8. Since the dos  MODE  command will do the same thing, I have never used
  9. ANSI.SYS in this way.  After making this patch, the  ESC[=#h  command
  10. will change the screen border to the color #, where # is from 0 - 7, 0
  11. being black, and 7 being white.  Look in the BASIC manual under the 
  12. COLOR command to learn which values give which colors.  Here is the patch:
  13.  
  14. Enter:
  15. DEBUG ANSI.SYS <RETURN>
  16.  
  17. Search for the area to patch, enter:
  18. S 100 L673 3C 07 77 F1 72 06 88 0E FA 00 EB E9 B4 00 CD 10 <RETURN>
  19.  
  20. Note the address where this occurs (in DOS 3.1 this will be 5DC), enter:
  21. E <the address you noted> <RETURN>
  22. 50 <SPACE> 53 <SPACE> B7 <SPACE> 00 <SPACE> 88 <SPACE> C3 <SPACE> 
  23. B4 <SPACE> 0B <SPACE> CD <SPACE> 10 <SPACE> 58 <SPACE> 58 <SPACE> 
  24. 90 <SPACE> 90 <SPACE> 90 <SPACE> 90 <RETURN>
  25.  
  26. Save the changes you made and quit, enter:
  27. W <RETURN>
  28. Q <RETURN>
  29.  
  30.  
  31. You have now patched ANSI.SYS.  I hope you didn't change your only copy.
  32. If you would like to know an interesting use for this, read on:
  33. In your AUTOEXEC.BAT file add the line:
  34.  
  35. PROMPT $e[s$e[24A$p$e[K$e[2;1H$e[K$e[u$n$g$e[=1h$e[37;44m
  36.  
  37. This will change the screen color to white on blue, and the border to
  38. blue every time you see the dos prompt.  It will also print the current
  39. directory in the upper-left corner of the screen.  I find this damned
  40. convenient, but if you just want the color, not the directory display,
  41. add this line to your AUTOEXEC.BAT file.
  42.  
  43. PROMPT $e[=1h$e[37;44m$n$g
  44.  
  45. If you don't have the IBM-DOS Technical Reference Manual, get it!  It
  46. explains all the features of the ANSI.SYS driver, and all of the DOS 
  47. FUNCTION CALLS, and much more.  I don't know how I'd work without it.
  48.  
  49. Enjoy, Peter Nelson
  50.  
  51.